package com.neu.flashmall.order.controller;

import com.neu.common.utils.Result;
import com.neu.flashmall.order.entity.OmsPayment;
import com.neu.flashmall.order.service.OmsPaymentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("oms_payment")
@Api(value = "支付信息Controller")
public class OmsPaymentController {
    @Resource
    private OmsPaymentService omsPaymentService;

    @PostMapping("/insert")
    @ApiOperation(value = "添加支付信息")
    public Result insert(@RequestBody OmsPayment omsPayment){
        if(omsPaymentService.insert(omsPayment) > 0){
            return Result.ok().setMessage("支付信息添加成功");
        }
        return Result.error().setMessage("支付信息添加失败");
    }
}
